import CanvasAbstract from './canvasAbstract'
import boss from '../model/boss'
import config from '../config'

class Bullet extends CanvasAbstract implements ICanvas {
  num(): number {
    return 0
  }
  model(): ModelConstructor {
    return boss
  }
  render(): void {
    this.createModels()
    this.renderModels()
  }
  // 批量产生坐标
  protected createModels() {
    ;[{ x: config.canvas.width / 2 - config.model.width / 2, y: config.canvas.height - config.model.height }].forEach(
      (position) => {
        const model = this.model()
        const instance = new model(position.x, position.y)
        this.models.push(instance)
      }
    )
  }
}

export default new Bullet('boss')
